package com.eisula.sc.database;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.annotations.Proxy;

@Entity
@Table(name = "t_delito")
@Proxy(lazy = false)
public class Delito {

	private int id;
	private boolean haSidoVictima;
	private String tipo;
	private boolean denuncio;

	private List<DelitoHogar> delitoHogarList;

	// --------------------------------------------------------------------------------

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	// --------------------------------------------------------------------------------

	public boolean isHaSidoVictima() {
		return haSidoVictima;
	}

	public void setHaSidoVictima(boolean haSidoVictima) {
		this.haSidoVictima = haSidoVictima;
	}

	// --------------------------------------------------------------------------------

	public String getTipo() {
		return tipo;
	}

	public void setTipo(String tipo) {
		this.tipo = tipo;
	}

	// --------------------------------------------------------------------------------

	public boolean isDenuncio() {
		return denuncio;
	}

	public void setDenuncio(boolean denuncio) {
		this.denuncio = denuncio;
	}

	// --------------------------------------------------------------------------------

	@OneToMany(mappedBy = "delitoId", orphanRemoval = true)
	@LazyCollection(LazyCollectionOption.TRUE)
	public List<DelitoHogar> getDelitoHogarList() {
		return delitoHogarList;
	}

	public void setDelitoHogarList(List<DelitoHogar> delitoHogarList) {
		this.delitoHogarList = delitoHogarList;
	}

	// --------------------------------------------------------------------------------

}
